package com.tedu.springdemo.day04;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

//实例工厂    方法：返回值 反对象
//@Bean 注解  用于方法上 返回对象
@Component
public class NetconnInstanceFactory {
    @Bean("nc")
    public NetConnection getInstance(){
        NetConnection nc=new NetConnection();
        nc.load();nc.ping();nc.conn();
        return nc;
    }
}
